
/* webjies.editor.js
Webjies editor user interface
depends on webjies.ui.js
*/


//////////////////////////////
// Jie editor class/control declaraction
webjies.jieEditor = function (canvas) {
    //variables
    this.canvas = canvas;
    this.jie = null;
    this.paper = null;

    //map functions
    this.load = function (jie) {
        this.jie = jie;
    };
    this.clear = function () {
        this.jie = [];
        if (this.paper != null)
            this.paper.clear();
        this.initPaper();
    };
    this.initPaper = function () {
        $(this.canvas).addClass('wjmap');

        var xSize = $(this.canvas).width()
        var ySize = $(this.canvas).height()
        this.paper = new Raphael($(this.canvas)[0], xSize, ySize);
    };

    //canvas initialization (note: technically this method is called using the webjies.map method)
    this.initPaper();


    return this;
};
//////////////////////////////